﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Csla.Server.Hosts;
using System.ServiceModel;
using System.ServiceModel.Activation;

namespace OpenExpressApp.Server.WPFHost
{
    /// <summary>
    /// 标记了ConcurrencyMode = ConcurrencyMode.Multiple
    /// 来表示多线程进行
    /// </summary>
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class MultiThreadWCFPortal : IWcfPortal
    {
        private WcfPortal _innerPortal = new WcfPortal();

        #region IWcfPortal Members

        public Csla.Server.Hosts.WcfChannel.WcfResponse Create(Csla.Server.Hosts.WcfChannel.CreateRequest request)
        {
            return this._innerPortal.Create(request);
        }

        public Csla.Server.Hosts.WcfChannel.WcfResponse Delete(Csla.Server.Hosts.WcfChannel.DeleteRequest request)
        {
            return this._innerPortal.Delete(request);
        }

        public Csla.Server.Hosts.WcfChannel.WcfResponse Fetch(Csla.Server.Hosts.WcfChannel.FetchRequest request)
        {
            return this._innerPortal.Fetch(request);
        }

        public Csla.Server.Hosts.WcfChannel.WcfResponse Update(Csla.Server.Hosts.WcfChannel.UpdateRequest request)
        {
            return this._innerPortal.Update(request);
        }

        #endregion
    }
}